package com.lyl.xxx.modules.system.account.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lyl.xxx.modules.system.account.dao.SysUserRoleDao;
import com.lyl.xxx.modules.system.account.entity.SysUserRole;
import com.lyl.xxx.modules.system.account.service.SysUserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 用户和角色关联表(SysUserRole)表服务实现类
 *
 * @author Mr Luo
 * @since 2022-09-19 11:14:04
 */
@Service("sysUserRoleService")
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleDao, SysUserRole> implements SysUserRoleService {

    @Override
    public List<Long> getAdminUserIds() {
        return lambdaQuery().eq(SysUserRole::getRoleId, 101).list()
                .stream().map(SysUserRole::getUserId).collect(Collectors.toList());
    }
}

